#ifndef _FIG_EXPOLDING_H_
#define _FIG_EXPOLDING_H_

#include "ui/ui_manager.h"
#include "vfx/sfx.h"




class FIGExploding
{
public:

	const static float  DISAPPEAR_DURATION;

	enum EXPLODING_TYPES
	{
		EXPLODING_TYPE_NORMAL,
		EXPLODING_TYPE_SmallHIT,
		EXPLODING_ROKETSMOKE,
		TRAIL_JET,

		CRAFT_PIECES,
		CRAFT_PIECES_TRIANGLE_FRAME,
		CRAFT_PIECES_TRIANGLE_MAIN,

		PICKUP_TRAIL,
		PICKUP_PICKED,

		EXPLODING_TYPES_COUNT
		
	};

	FIGExploding(FIGExploding::EXPLODING_TYPES Type);
	~FIGExploding();

	virtual void						Render(const math::Vec2& Offset,float Scale);
	virtual void						RenderDebug(const math::Vec2& Offset,float Scale);
	virtual void						Tick(float dt);


	void								Clear();
	void								Load(const std::string& Name);
	void								ParticleLoad(const std::string& Name,int	TriggerCount);
	bool								IsAlive() const { return m_IsAlive; };
	void								ReSpawn(	const math::Vec2& Pos,													
													float ScaleSize,
													float Rotation
													);
	FIGExploding::EXPLODING_TYPES		GetType()const { return m_Type; };

	


protected:

	void								MapTypeToName();
	// FOR Craft Peices Only
	void								Randomize();

	bool								m_IsAlive;
	math::Vec2							m_Pos;
	math::Vec2							m_Size;
	ui::UISprite						m_Sprite;
	FIGExploding::EXPLODING_TYPES		m_Type;
	float								m_DisappearCounter;
	float								m_DisappearDuration;

	float								m_Rotation;
	float								m_Alpha;
	math::Vec2							m_RandomDir;
	math::Vec2							m_RandomMovePos;
	float								m_RotationSpeed;

	std::vector<part2d::Part2D*>		m_pParticles;
	std::vector<int>					m_TriggerCounts;

	bool								m_bShouldRandomRotate;	
	float								m_Scale;					

};

#endif